from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow
from PyQt5.QtWebEngineWidgets import QWebEngineView
import sys


class Demo2(QMainWindow):

    def __init__(self):
        super(Demo2, self).__init__()
        # 设置主窗体标签
        self.setWindowTitle("demo2")
        self.status = self.statusBar()
        self.status.showMessage("这是状态栏提示", 5000)
        self.browser = QWebEngineView()
        self.setCentralWidget(self.browser)

        self.browser.page().fullScreenRequested.connect(self._fullScreenRequested)

        self.browser.page().load(QUrl('https://www.baidu.com'))
        # time.sleep(10)

    def cbData(self,x):
        print("-------")
        print(x)
    def _fullScreenRequested(request):
        request.accept()
        # self.browser.showFullScreen()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    main = Demo2()
    main.show()
    sys.exit(app.exec_())